Photomaker
Rapid customization within seconds, with no additional LoRA training. Ensures impressive ID fidelity, offering diversity, promising text controllability, and high-quality generation.
Tip
- Upload more photos of the person to be customized to improve ID fidelity.
- Increase start_merge_step to get more variation and creativity
- Only available Enterprise Plans due to high GPU usage
- Python
- JavaScript
- php
import requests
import json
url = "https://api.imagepipeline.io/photomaker/v1"
headers = {
"API-Key": "Your API Key"
}
data = {
"init_images": ["https://media.licdn.com/dms/image/C5603AQHLq9r0dMcHOQ/profile-displayphoto-shrink_800_800/0/1637752240713?e=2147483647&v=beta&t=aXGLXUn0XaC6ox2nokuHiPkHg9jBoAJ0clft_NlSOXc", "https://i1.sndcdn.com/avatars-000134994061-hy4sy2-t500x500.jpg"],
"negative_prompt":"(asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth, grayscale",
"prompt": "realistic, cinematic still young man img in a professional pinstriped suit, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous",
"num_inference_steps": 20,
"seed": 100902,
"samples": 2,
"width": 1024,
"height": 1024,
"start_merge_step": 6,
"guidance_scale": 7.5,
"server_id": ""
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const url = "https://api.imagepipeline.io/photomaker/v1";
const headers = {
"API-Key": "Your API Key",
"Content-Type": "application/json"
};
const data = {
"init_images": ["https://media.licdn.com/dms/image/C5603AQHLq9r0dMcHOQ/profile-displayphoto-shrink_800_800/0/1637752240713?e=2147483647&v=beta&t=aXGLXUn0XaC6ox2nokuHiPkHg9jBoAJ0clft_NlSOXc", "https://i1.sndcdn.com/avatars-000134994061-hy4sy2-t500x500.jpg"],
"negative_prompt":"(asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth, grayscale",
"prompt": "realistic, cinematic still young man img in a professional pinstriped suit, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous",
"num_inference_steps": 20,
"seed": 100902,
"samples": 2,
"width": 1024,
"height": 1024,
"start_merge_step": 6,
"guidance_scale": 7.5,
"server_id": ""
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch((error) => console.error('Error:', error));
<?php
$url = "https://api.imagepipeline.io/photomaker/v1";
$headers = array(
"API-Key: Your-API-Key",
"Content-Type: application/json"
);
$data = array(
"init_images"=> ["https://media.licdn.com/dms/image/C5603AQHLq9r0dMcHOQ/profile-displayphoto-shrink_800_800/0/1637752240713?e=2147483647&v=beta&t=aXGLXUn0XaC6ox2nokuHiPkHg9jBoAJ0clft_NlSOXc", "https://i1.sndcdn.com/avatars-000134994061-hy4sy2-t500x500.jpg"],
"negative_prompt"=>"(asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth, grayscale",
"prompt"=> "realistic, cinematic still young man img in a professional pinstriped suit, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous",
"num_inference_steps"=> 20,
"seed"=> 100902,
"samples"=> 2,
"width"=> 1024,
"height"> 1024,
"start_merge_step"=> 6,
"guidance_scale"=> 7.5,
"server_id": ""
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if($response === FALSE){
die(curl_error($ch));
}
$responseData = json_decode($response, TRUE);
curl_close($ch);
var_dump($responseData);
?>
JSON Parameters
Parameter | Permissible values | Notes |
---|---|---|
init_images | str, array | Add your images here or any person who has consented for their images to be used to generate AI images |
prompt | str, 75 tokens | Check our Prompt Guide for tips |
negative_prompt | str, 75 tokens | Check our Prompt Guide for tips |
num_inference_steps | int, [1-100] | Noise is removed with each step, resulting in a higher-quality image over time. Ideal value 15-20 |
samples | int, [1-4] | Generates a maximum of 4 samples per API call |
guidance_scale | float, [1-20] | Higher guidance scale prioritizes text prompt relevance but sacrifices image quality. Ideal value 7.5-12.5 |
width | int | Width in pixels. Lower than or equal to 1024 for best results |
height | int | Height in pixels. Lower than or equal to 1024 for best results |
start_merge_step | float,[0-20] | How much adapter should guide the generation |
server_id | string | Server_id for enterprise subscription. Provide any for load-balancing, specific id for routing |
webhook | string | Webhook to send generated image to |
Status
Your response will include a status
.
- If the
status
=SUCCESS
, you will also havedownload_urls
that will have the links to your generated image based on the number of samples you have entered. The maximum number of samples that can be generated is 4. - If the
status
=PENDING
, you will receive aid
. You can use the status endpoint to fetch your image using theid
. - If the
status
=FAILURE
, you will receive only an error message.
Endpoint: [GET]
https://api.imagepipeline.io/photomaker/v1/status/{{id}}
Pass the API-Key as the authorization in the header.
- Input
- Output
{
"init_images": ["https://media.licdn.com/dms/image/C5603AQHLq9r0dMcHOQ/profile-displayphoto-shrink_800_800/0/1637752240713?e=2147483647&v=beta&t=aXGLXUn0XaC6ox2nokuHiPkHg9jBoAJ0clft_NlSOXc", "https://i1.sndcdn.com/avatars-000134994061-hy4sy2-t500x500.jpg"],
"negative_prompt":"(asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth, grayscale",
"prompt": "realistic, cinematic still young man img in a professional pinstriped suit, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous",
"num_inference_steps": 20,
"seed": 100902,
"samples": 2,
"width": 1024,
"height": 1024,
"start_merge_step": 6,
"guidance_scale": 7.5,
"server_id": ""
}
{
"download_urls": [
"https://f005.backblazeb2.com/b2api/v2/b...",
]
}